﻿<div class="box">
    <header>
        <h3>@T(Res.Name("Result"), JDM.Int64(Model.TotalCount))</h3>
    </header>
    <section>
        <ul class="unit-list search-result">
        @foreach(var i in Model.Items)
        {
            var t_item = (i.CatalogItem.Translations as IEnumerable<dynamic>)
                .SingleOrDefault(x => JDM.Int32(x.Language.EntityID) ==
                    JDM.Int32(Svc.Localization.Language.EntityID));
            <li class="unit search-result">
                <section>
                    <div class="html text-short">
                        <h4><a href="@Url.Action(Loc.Act("Show").Ctrl("Item").Area("Store").Set(new
                        {
                            id = JDM.Int32(i.EntityID)
                        }).Localized())">@(t_item != null ? JDM.String(t_item.Name) : JDM.String(i.SKU))</a></h4>
                        <p>@Html.Raw(HtmlUtility.FromPlainText(t_item != null ? JDM.String(t_item.ShortDescription) : String.Empty))</p>
                    </div>
                </section>
            </li>
        }
        </ul>
    </section>
    <footer>
        <nav>
            <a href="@Url.Action(Loc.Act("Index").Ctrl("Item").Area("Store").Set(new
            {
                searchTerm = Request.QueryParam("searchTerm")
            }).Localized())">@T(Res.In("Common").Of("Vocab").Name("All"))</a>
        </nav>
    </footer>
</div>